<template>
	<om-formsub-outer :index="index" :checkedit="checkedit">
		<om-autoform ref="autoform" :initConfigData="autoformdata" :initValue="initValue"></om-autoform>
	</om-formsub-outer>
</template>

<script>
	import {buildSubFormData, subOnLoad, changeEditor,configSelectData,hasValue} from '../../../static/js/formUtil.js';
	import { ignoreHtml,ptFloat,minusF,getDateStr} from '@/static/js/common.js';
	export default {
		provide() {
			return {
				formPage: this
			};
		},
		data() {
			return buildSubFormData({
				userCacheKey:"bro-th-returnApply-title5-cache"
			})
		},
		methods:{
			
		},
		onShow() {
			let _that = this
			if(_that.$refs.autoform){
				uni.getStorage({
					key:_that.userCacheKey,
					success:(res)=>{
						if(res.data){
							let d = res.data
							let formdata = _that.$refs.autoform.formdata
							 formdata.userPostId = d.userId
							 formdata.userId = d.userId
							 formdata.userName = d.userName
							 formdata.postId = d.posId
							 formdata.postName = d.posName
							uni.removeStorage({
								key:_that.userCacheKey
							})
						}
					}
				})
			}
		},
		onLoad(e) {
			let _that = this
			subOnLoad(_that, e, function() {
			if(e.configDataCacheKey){
				uni.getStorage({
					key: e.configDataCacheKey,
					success: function(res) {
						if(res.data && Object.prototype.toString.call(res.data)==='[object Array]'){
							_that.autoformdata = res.data
							Object.assign(_that.initValue, _that.formdata)
							_that.autoformdata[0].order = _that.order
								changeEditor("title5","userPostId",{
									link:"../../public/pageSearch/pageSearch",
									"linkParam":{
										other:JSON.stringify({}),
										namefield:"userPosName",
										url:"orgInstPosUserOfficial/findListByOrg",
										cachename:_that.userCacheKey,
										placeholder:'请输入姓名,岗位',
										searchfield:"q",
									}
								},null,_that.autoformdata)
							}
						}
					})
				}
			})
		}
	}
</script>

<style>
</style>                                                                                                                                                                                                                                                                                                                                                                                                                                                  
